/**
 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.triumphsys.icici.cmeeting.portlet.model.impl;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.impl.BaseModelImpl;
import com.liferay.portal.service.ServiceContext;
import com.liferay.portal.util.PortalUtil;

import com.liferay.portlet.expando.model.ExpandoBridge;
import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;

import com.triumphsys.icici.cmeeting.portlet.model.CMProposal;
import com.triumphsys.icici.cmeeting.portlet.model.CMProposalModel;

import java.io.Serializable;

import java.lang.reflect.Proxy;

import java.sql.Types;

import java.util.Date;

/**
 * The base model implementation for the CMProposal service. Represents a row in the &quot;CM_POLICIES&quot; database table, with each column mapped to a property of this class.
 *
 * <p>
 * This implementation and its corresponding interface {@link com.triumphsys.icici.cmeeting.portlet.model.CMProposalModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link CMProposalImpl}.
 * </p>
 *
 * <p>
 * Never modify or reference this class directly. All methods that expect a c m proposal model instance should use the {@link com.triumphsys.icici.cmeeting.portlet.model.CMProposal} interface instead.
 * </p>
 *
 * @author Triumphsys
 * @see CMProposalImpl
 * @see com.triumphsys.icici.cmeeting.portlet.model.CMProposal
 * @see com.triumphsys.icici.cmeeting.portlet.model.CMProposalModel
 * @generated
 */
public class CMProposalModelImpl extends BaseModelImpl<CMProposal>
	implements CMProposalModel {
	public static final String TABLE_NAME = "CM_POLICIES";
	public static final Object[][] TABLE_COLUMNS = {
			{ "proposalId", new Integer(Types.BIGINT) },
			{ "groupId", new Integer(Types.BIGINT) },
			{ "meetingId", new Integer(Types.BIGINT) },
			{ "userId", new Integer(Types.BIGINT) },
			{ "createDate", new Integer(Types.TIMESTAMP) },
			{ "modifiedDate", new Integer(Types.TIMESTAMP) },
			{ "opsRegionId", new Integer(Types.BIGINT) },
			{ "proposalDesc", new Integer(Types.VARCHAR) },
			{ "proposalFileId", new Integer(Types.BIGINT) },
			{ "extractFileId", new Integer(Types.BIGINT) },
			{ "momFilId", new Integer(Types.BIGINT) },
			{ "active_", new Integer(Types.VARCHAR) },
			{ "status", new Integer(Types.VARCHAR) },
			{ "proposalTypeId", new Integer(Types.BIGINT) },
			{ "entityId", new Integer(Types.BIGINT) },
			{ "meetingStatus", new Integer(Types.VARCHAR) },
			{ "subForumId", new Integer(Types.BIGINT) },
			{ "compantCode", new Integer(Types.BIGINT) }
		};
	public static final String TABLE_SQL_CREATE = "create table CM_POLICIES (proposalId LONG not null primary key,groupId LONG,meetingId LONG,userId LONG,createDate DATE null,modifiedDate DATE null,opsRegionId LONG,proposalDesc VARCHAR(75) null,proposalFileId LONG,extractFileId LONG,momFilId LONG,active_ VARCHAR(75) null,status VARCHAR(75) null,proposalTypeId LONG,entityId LONG,meetingStatus VARCHAR(75) null,subForumId LONG,compantCode LONG)";
	public static final String TABLE_SQL_DROP = "drop table CM_POLICIES";
	public static final String ORDER_BY_JPQL = " ORDER BY cmProposal.proposalId ASC";
	public static final String ORDER_BY_SQL = " ORDER BY CM_POLICIES.proposalId ASC";
	public static final String DATA_SOURCE = "liferayDataSource";
	public static final String SESSION_FACTORY = "liferaySessionFactory";
	public static final String TX_MANAGER = "liferayTransactionManager";
	public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.entity.cache.enabled.com.triumphsys.icici.cmeeting.portlet.model.CMProposal"),
			true);
	public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.finder.cache.enabled.com.triumphsys.icici.cmeeting.portlet.model.CMProposal"),
			true);
	public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get(
				"lock.expiration.time.com.triumphsys.icici.cmeeting.portlet.model.CMProposal"));

	public CMProposalModelImpl() {
	}

	public long getPrimaryKey() {
		return _proposalId;
	}

	public void setPrimaryKey(long pk) {
		setProposalId(pk);
	}

	public Serializable getPrimaryKeyObj() {
		return new Long(_proposalId);
	}

	public long getProposalId() {
		return _proposalId;
	}

	public void setProposalId(long proposalId) {
		_proposalId = proposalId;
	}

	public long getGroupId() {
		return _groupId;
	}

	public void setGroupId(long groupId) {
		_groupId = groupId;
	}

	public long getMeetingId() {
		return _meetingId;
	}

	public void setMeetingId(long meetingId) {
		_meetingId = meetingId;
	}

	public long getUserId() {
		return _userId;
	}

	public void setUserId(long userId) {
		_userId = userId;
	}

	public String getUserUuid() throws SystemException {
		return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
	}

	public void setUserUuid(String userUuid) {
		_userUuid = userUuid;
	}

	public Date getCreateDate() {
		return _createDate;
	}

	public void setCreateDate(Date createDate) {
		_createDate = createDate;
	}

	public Date getModifiedDate() {
		return _modifiedDate;
	}

	public void setModifiedDate(Date modifiedDate) {
		_modifiedDate = modifiedDate;
	}

	public long getOpsRegionId() {
		return _opsRegionId;
	}

	public void setOpsRegionId(long opsRegionId) {
		_opsRegionId = opsRegionId;
	}

	public String getProposalDesc() {
		if (_proposalDesc == null) {
			return StringPool.BLANK;
		}
		else {
			return _proposalDesc;
		}
	}

	public void setProposalDesc(String proposalDesc) {
		_proposalDesc = proposalDesc;
	}

	public long getProposalFileId() {
		return _proposalFileId;
	}

	public void setProposalFileId(long proposalFileId) {
		_proposalFileId = proposalFileId;
	}

	public long getExtractFileId() {
		return _extractFileId;
	}

	public void setExtractFileId(long extractFileId) {
		_extractFileId = extractFileId;
	}

	public long getMomFilId() {
		return _momFilId;
	}

	public void setMomFilId(long momFilId) {
		_momFilId = momFilId;
	}

	public String getActive() {
		if (_active == null) {
			return StringPool.BLANK;
		}
		else {
			return _active;
		}
	}

	public void setActive(String active) {
		_active = active;
	}

	public String getStatus() {
		if (_status == null) {
			return StringPool.BLANK;
		}
		else {
			return _status;
		}
	}

	public void setStatus(String status) {
		_status = status;
	}

	public long getProposalTypeId() {
		return _proposalTypeId;
	}

	public void setProposalTypeId(long proposalTypeId) {
		_proposalTypeId = proposalTypeId;
	}

	public long getEntityId() {
		return _entityId;
	}

	public void setEntityId(long entityId) {
		_entityId = entityId;
	}

	public String getMeetingStatus() {
		if (_meetingStatus == null) {
			return StringPool.BLANK;
		}
		else {
			return _meetingStatus;
		}
	}

	public void setMeetingStatus(String meetingStatus) {
		_meetingStatus = meetingStatus;
	}

	public long getSubForumId() {
		return _subForumId;
	}

	public void setSubForumId(long subForumId) {
		_subForumId = subForumId;
	}

	public long getCompantCode() {
		return _compantCode;
	}

	public void setCompantCode(long compantCode) {
		_compantCode = compantCode;
	}

	public CMProposal toEscapedModel() {
		if (isEscapedModel()) {
			return (CMProposal)this;
		}
		else {
			return (CMProposal)Proxy.newProxyInstance(CMProposal.class.getClassLoader(),
				new Class[] { CMProposal.class },
				new AutoEscapeBeanHandler(this));
		}
	}

	public ExpandoBridge getExpandoBridge() {
		if (_expandoBridge == null) {
			_expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(0,
					CMProposal.class.getName(), getPrimaryKey());
		}

		return _expandoBridge;
	}

	public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
		getExpandoBridge().setAttributes(serviceContext);
	}

	public Object clone() {
		CMProposalImpl cmProposalImpl = new CMProposalImpl();

		cmProposalImpl.setProposalId(getProposalId());

		cmProposalImpl.setGroupId(getGroupId());

		cmProposalImpl.setMeetingId(getMeetingId());

		cmProposalImpl.setUserId(getUserId());

		cmProposalImpl.setCreateDate(getCreateDate());

		cmProposalImpl.setModifiedDate(getModifiedDate());

		cmProposalImpl.setOpsRegionId(getOpsRegionId());

		cmProposalImpl.setProposalDesc(getProposalDesc());

		cmProposalImpl.setProposalFileId(getProposalFileId());

		cmProposalImpl.setExtractFileId(getExtractFileId());

		cmProposalImpl.setMomFilId(getMomFilId());

		cmProposalImpl.setActive(getActive());

		cmProposalImpl.setStatus(getStatus());

		cmProposalImpl.setProposalTypeId(getProposalTypeId());

		cmProposalImpl.setEntityId(getEntityId());

		cmProposalImpl.setMeetingStatus(getMeetingStatus());

		cmProposalImpl.setSubForumId(getSubForumId());

		cmProposalImpl.setCompantCode(getCompantCode());

		return cmProposalImpl;
	}

	public int compareTo(CMProposal cmProposal) {
		int value = 0;

		if (getProposalId() < cmProposal.getProposalId()) {
			value = -1;
		}
		else if (getProposalId() > cmProposal.getProposalId()) {
			value = 1;
		}
		else {
			value = 0;
		}

		if (value != 0) {
			return value;
		}

		return 0;
	}

	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}

		CMProposal cmProposal = null;

		try {
			cmProposal = (CMProposal)obj;
		}
		catch (ClassCastException cce) {
			return false;
		}

		long pk = cmProposal.getPrimaryKey();

		if (getPrimaryKey() == pk) {
			return true;
		}
		else {
			return false;
		}
	}

	public int hashCode() {
		return (int)getPrimaryKey();
	}

	public String toString() {
		StringBundler sb = new StringBundler(37);

		sb.append("{proposalId=");
		sb.append(getProposalId());
		sb.append(", groupId=");
		sb.append(getGroupId());
		sb.append(", meetingId=");
		sb.append(getMeetingId());
		sb.append(", userId=");
		sb.append(getUserId());
		sb.append(", createDate=");
		sb.append(getCreateDate());
		sb.append(", modifiedDate=");
		sb.append(getModifiedDate());
		sb.append(", opsRegionId=");
		sb.append(getOpsRegionId());
		sb.append(", proposalDesc=");
		sb.append(getProposalDesc());
		sb.append(", proposalFileId=");
		sb.append(getProposalFileId());
		sb.append(", extractFileId=");
		sb.append(getExtractFileId());
		sb.append(", momFilId=");
		sb.append(getMomFilId());
		sb.append(", active=");
		sb.append(getActive());
		sb.append(", status=");
		sb.append(getStatus());
		sb.append(", proposalTypeId=");
		sb.append(getProposalTypeId());
		sb.append(", entityId=");
		sb.append(getEntityId());
		sb.append(", meetingStatus=");
		sb.append(getMeetingStatus());
		sb.append(", subForumId=");
		sb.append(getSubForumId());
		sb.append(", compantCode=");
		sb.append(getCompantCode());
		sb.append("}");

		return sb.toString();
	}

	public String toXmlString() {
		StringBundler sb = new StringBundler(58);

		sb.append("<model><model-name>");
		sb.append("com.triumphsys.icici.cmeeting.portlet.model.CMProposal");
		sb.append("</model-name>");

		sb.append(
			"<column><column-name>proposalId</column-name><column-value><![CDATA[");
		sb.append(getProposalId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>groupId</column-name><column-value><![CDATA[");
		sb.append(getGroupId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>meetingId</column-name><column-value><![CDATA[");
		sb.append(getMeetingId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>userId</column-name><column-value><![CDATA[");
		sb.append(getUserId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>createDate</column-name><column-value><![CDATA[");
		sb.append(getCreateDate());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
		sb.append(getModifiedDate());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>opsRegionId</column-name><column-value><![CDATA[");
		sb.append(getOpsRegionId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>proposalDesc</column-name><column-value><![CDATA[");
		sb.append(getProposalDesc());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>proposalFileId</column-name><column-value><![CDATA[");
		sb.append(getProposalFileId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>extractFileId</column-name><column-value><![CDATA[");
		sb.append(getExtractFileId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>momFilId</column-name><column-value><![CDATA[");
		sb.append(getMomFilId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>active</column-name><column-value><![CDATA[");
		sb.append(getActive());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>status</column-name><column-value><![CDATA[");
		sb.append(getStatus());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>proposalTypeId</column-name><column-value><![CDATA[");
		sb.append(getProposalTypeId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>entityId</column-name><column-value><![CDATA[");
		sb.append(getEntityId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>meetingStatus</column-name><column-value><![CDATA[");
		sb.append(getMeetingStatus());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>subForumId</column-name><column-value><![CDATA[");
		sb.append(getSubForumId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>compantCode</column-name><column-value><![CDATA[");
		sb.append(getCompantCode());
		sb.append("]]></column-value></column>");

		sb.append("</model>");

		return sb.toString();
	}

	private long _proposalId;
	private long _groupId;
	private long _meetingId;
	private long _userId;
	private String _userUuid;
	private Date _createDate;
	private Date _modifiedDate;
	private long _opsRegionId;
	private String _proposalDesc;
	private long _proposalFileId;
	private long _extractFileId;
	private long _momFilId;
	private String _active;
	private String _status;
	private long _proposalTypeId;
	private long _entityId;
	private String _meetingStatus;
	private long _subForumId;
	private long _compantCode;
	private transient ExpandoBridge _expandoBridge;
}